Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

723
Vistas
How to create and use a Room Database in Kotlin [Dagger-Hilt]

This is a self-answered question which I intended to ask earlier as I had rep exposure issues in my project, but ended up fixing it after a couple of hours of research. Instead of staying silent, I thought this might help someone in the future. This tutorial demonstrates how you can create a Room database and use it within an activity/fragment. The example use case given here is querying the size of your database and updating the views in a fragment.

Note: There is some Dagger-Hilt dependency injection in the code that follows, but the same methodology should apply if you're manually doing your own dependency injection. I also expect that you have some basic knowledge of MVVM architecture. You may find useful Java related questions here if you're interested in other ways to do this involving LiveData: resource 1, resource 2; however, the focus is on Kotlin and this solution doesn't require LiveData.

over 4 years ago · Hanz Gallego
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda